<?php

namespace App\Providers;

use App\Services\ContractSign\ContractSignManager;
use App\Services\ContractSign\ContractSigner;
use App\Services\FaceRecognition\FaceRecognitionVerifier;
use App\Services\FaceRecognition\FaceRecognitionVerifierManager;
use App\Services\FourElement\FourElementVerifier;
use App\Services\FourElement\FourElementVerifierManager;
use App\Services\IdentityOcr\IdentityOcrVerifier;
use App\Services\IdentityOcr\IdentityOcrVerifierManager;
use App\Services\Sms\SmsSender;
use App\Services\Sms\SmsSenderManager;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(FourElementVerifierManager::class, function ($app) {
            return new FourElementVerifierManager($app);
        });

        $this->app->bind(FourElementVerifier::class, function ($app) {
            return $app->make(FourElementVerifierManager::class)->driver();
        });

        $this->app->singleton(IdentityOcrVerifierManager::class, function ($app) {
            return new IdentityOcrVerifierManager($app);
        });

        $this->app->bind(IdentityOcrVerifier::class, function ($app) {
            return $app->make(IdentityOcrVerifierManager::class)->driver();
        });

        $this->app->singleton(FaceRecognitionVerifierManager::class, function ($app) {
            return new FaceRecognitionVerifierManager($app);
        });

        $this->app->bind(FaceRecognitionVerifier::class, function ($app) {
            return $app->make(FaceRecognitionVerifierManager::class)->driver();
        });

        $this->app->singleton(ContractSignManager::class, function ($app) {
            return new ContractSignManager($app);
        });

        $this->app->bind(ContractSigner::class, function ($app) {
            return $app->make(ContractSignManager::class)->driver();
        });

        $this->app->singleton(SmsSenderManager::class, function ($app) {
            return new SmsSenderManager($app);
        });

        $this->app->bind(SmsSender::class, function ($app) {
            return $app->make(SmsSenderManager::class)->driver();
        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
